﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.Model;

namespace Common.UI.EM
{
    public abstract class GenericController
    {
        public abstract void Run();


        protected string GetFullName()
        {
            return String.Format("{0}, {1}", this.GetType().FullName, this.GetType().Module.Name).Replace(".dll", "");
        }

        protected Boolean CanExecute()
        {
            var rta = Common.Security.Authorization.CanExecute(this.GetFullName());
            if (!rta)
            {
                System.Windows.MessageBox.Show("Usted no tiene permiso para ejecutar dicha acción.", "CBE", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information);
            }
            return rta;
        }

    }
}
